<html>
<head><meta charset="utf-8"><title>Making THIR public · project-thir-unsafeck · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/278509-project-thir-unsafeck/index.html">project-thir-unsafeck</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/278509-project-thir-unsafeck/topic/Making.20THIR.20public.html">Making THIR public</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="229910956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/278509-project-thir-unsafeck/topic/Making%20THIR%20public/near/229910956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/278509-project-thir-unsafeck/topic/Making.20THIR.20public.html#229910956">(Mar 11 2021 at 19:30)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> about <a href="https://github.com/rust-lang/rust/issues/82860">#82860</a>, I made the THIR public to be used for <code>-Zunpretty=thir-tree</code>, I think this should be fine and even probably desirable?</p>



<a name="229911000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/278509-project-thir-unsafeck/topic/Making%20THIR%20public/near/229911000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/278509-project-thir-unsafeck/topic/Making.20THIR.20public.html#229911000">(Mar 11 2021 at 19:30)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> is willing to approve with this detail sorted <span aria-label="heart" class="emoji emoji-2764" role="img" title="heart">:heart:</span></p>



<a name="229911191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/278509-project-thir-unsafeck/topic/Making%20THIR%20public/near/229911191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/278509-project-thir-unsafeck/topic/Making.20THIR.20public.html#229911191">(Mar 11 2021 at 19:31)</a>:</h4>
<p>I was wondering if it was ok to make everything public and if there isn't a way to avoid that, at least one that makes sense</p>



<a name="229911368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/278509-project-thir-unsafeck/topic/Making%20THIR%20public/near/229911368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/278509-project-thir-unsafeck/topic/Making.20THIR.20public.html#229911368">(Mar 11 2021 at 19:32)</a>:</h4>
<p>we could have 2 sets of types, one the internal ones, non pub and then the ones we would use for dumping but the thing is that both will be equals if I'm not wrong and hence won't make a lot of sense IMO</p>



<a name="229911477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/278509-project-thir-unsafeck/topic/Making%20THIR%20public/near/229911477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/278509-project-thir-unsafeck/topic/Making.20THIR.20public.html#229911477">(Mar 11 2021 at 19:33)</a>:</h4>
<p>also ... how the rest of the crates of rustc do this same thing?, when we dump ast, mir and other stuff, how do we do it?</p>



<a name="229911550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/278509-project-thir-unsafeck/topic/Making%20THIR%20public/near/229911550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/278509-project-thir-unsafeck/topic/Making.20THIR.20public.html#229911550">(Mar 11 2021 at 19:33)</a>:</h4>
<p>I think most of them have to be used for queries and so are declared and exposed by <code>rustc_middle</code>?</p>



<a name="229911833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/278509-project-thir-unsafeck/topic/Making%20THIR%20public/near/229911833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/278509-project-thir-unsafeck/topic/Making.20THIR.20public.html#229911833">(Mar 11 2021 at 19:35)</a>:</h4>
<p>Mhh nevermind, only MIR is declared in <code>rustc_middle</code> actually</p>



<a name="229911859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/278509-project-thir-unsafeck/topic/Making%20THIR%20public/near/229911859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/278509-project-thir-unsafeck/topic/Making.20THIR.20public.html#229911859">(Mar 11 2021 at 19:35)</a>:</h4>
<p>But take <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.Expr.html"><code>hir::Expr</code></a> for example, every field is public</p>



<a name="229912045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/278509-project-thir-unsafeck/topic/Making%20THIR%20public/near/229912045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/278509-project-thir-unsafeck/topic/Making.20THIR.20public.html#229912045">(Mar 11 2021 at 19:37)</a>:</h4>
<p>And I think all the structs are public also, so that would be consistent with HIR</p>



<a name="229924882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/278509-project-thir-unsafeck/topic/Making%20THIR%20public/near/229924882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/278509-project-thir-unsafeck/topic/Making.20THIR.20public.html#229924882">(Mar 11 2021 at 21:00)</a>:</h4>
<p>I don't see a problem with it being public</p>



<a name="229924914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/278509-project-thir-unsafeck/topic/Making%20THIR%20public/near/229924914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/278509-project-thir-unsafeck/topic/Making.20THIR.20public.html#229924914">(Mar 11 2021 at 21:00)</a>:</h4>
<p>I think having the ability to dump it is a pretty good use case, <span class="user-mention" data-user-id="255061">@Léo Lanteri Thauvin</span></p>



<a name="229929913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/278509-project-thir-unsafeck/topic/Making%20THIR%20public/near/229929913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/278509-project-thir-unsafeck/topic/Making.20THIR.20public.html#229929913">(Mar 11 2021 at 21:33)</a>:</h4>
<p>r+ed</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>